import Vue from 'vue'
import { axios } from '@/utils/request'
import signMd5Utils from '@/utils/encryption/signMd5Utils'


export function requestApi(url,type,parameter,token) {
  let sign = signMd5Utils.getSign(url,type, parameter,token);
  //将签名和时间戳，添加在请求接口 Header
  let signHeader = {
    "X-Sign": sign,
    "X-TIMESTAMP": signMd5Utils.getDateTimeToString(),
    "sysModule": 'qsb',
    "X-Access-Token": token,
  };

  return axios({
    url: url,
    method: type ,
    data: parameter,
    headers: signHeader
  })
}
